package com.sjziei;

public class MyArray {
    private Student[] data;
    private int length;

    public MyArray(int size){
        this.data = new Student[size];
        this.length = 0;
    }
    public MyArray(){
        this(10);
    }

    public void append(Student student){
        this.data[this.length] = student;
        this.length++;
    }
    public Student get(int index){
        return this.data[index];
    }

    public int getLength() {
        return length;
    }

    public void deleteByIndex(int index) {
        for(int i=index+1; i<this.length;i++){
            this.data[i-1] = this.data[i];
        }
        this.length--;
    }
}
